package com.code.test;

import com.code.aop.MathCalculator;
import com.code.config.AOPConfig;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * todo
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/1/7
 */
public class IOCTest_AOP {

    @Test
    public void test01(){
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AOPConfig.class);

        MathCalculator mathCalculator = applicationContext.getBean(MathCalculator.class);

        mathCalculator.test(1, 1);
        mathCalculator.test(1, 0);

        applicationContext.close();
    }
}
